import { createSlice } from "@reduxjs/toolkit";

export const MenuStore = createSlice({
  name: "MenuStore",
  initialState: {
    menu: [],
    sidebarMenu: [],
    fullRoutes: [],
    layoutRoutes: [],
  },
  reducers: {
    setMenu: (state, action) => {
      state.menu = action.payload;
    },
    setSidebarMenu: (state, action) => {
      state.sidebarMenu = action.payload;
    },
    setFullRouteMenu: (state, action) => {
      state.fullRoutes = action.payload;
    },
    setLayoutRouteMenu: (state, action) => {
      state.layoutRoutes = action.payload;
    },
  },
});
const { setMenu, setSidebarMenu, setFullRouteMenu, setLayoutRouteMenu } = MenuStore.actions;
const reducer = MenuStore.reducer;
// eslint-disable-next-line react-refresh/only-export-components
export { setMenu, setSidebarMenu, setFullRouteMenu, setLayoutRouteMenu };
export default reducer;
